package com.example.TCP_measure;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    public static final String EXTRA_MESSAGE = "com.example.myapp.MESSAGE";
    public static final String EXTRA_MESSAGE2 = "com.example.myapp.MESSAGE2";
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button button=(Button)findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this,"正在测速",Toast.LENGTH_SHORT).show();
                Intent intent=new Intent(MainActivity.this,show_network.class);
                EditText editText=(EditText)findViewById(R.id.editText);
                EditText editText1=(EditText)findViewById(R.id.editText2);
                String message=editText.getText().toString();
                String message2=editText1.getText().toString();
                intent.putExtra(EXTRA_MESSAGE,message);
                intent.putExtra(EXTRA_MESSAGE2,message2);
                startActivity(intent);
            }
        });
    }
}